﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;

namespace WebApplicationProveedores
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BusinessLogic.CrearOrdenCompra("c2", "Rebe", 10, "coco");
        }

        protected void VerificarUsuario(object sender, EventArgs eventArgs)
        {
            var businees = new BusinessLogic();
            var provedor = businees.VerificarUsuario(TextBox1.Text, TextBox2.Text);
            if (provedor != 0)
            {
                var cookie = new HttpCookie("Prov") {Value = provedor.ToString(CultureInfo.InvariantCulture)};
                Response.Cookies.Add(cookie);
                Response.Redirect("~/Consultas.aspx");
            }
            else
            {
                MessageBox.Show("Usuario no  Válido");
            }
                                
        }
    }
}
